Repository navigation
[PULP-2416] Stream proxied S3 and Azure artifacts - #8364
Conversation
06d090a to
68994ae
Compare
|
I'll leave this as draft just to make sure nobody merges it. |
2afcda8 to
679196c
Compare
679196c to
92c46a0
Compare
Serve proxied artifacts without buffering the remote files. django-storages buffers files to provide a seekable interface, but this is unnecessary for the streaming use case. Keep synchronous storage I/O off the content application event loop. closes pulp#7806 Assisted By: Codex (GPT-5) Terra 5.6
92c46a0 to
799c348
Compare
| as compatibility identifiers. | ||
| If your deployment overrides `DOMAIN_STORAGE_BACKENDS` or configures object storage in | ||
| `STORAGES`, update implementation paths from `storages.backends.*` to | ||
| `pulpcore.vendor.storages.backends.*` to select the bundled code. |
There was a problem hiding this comment.
Realistically users shouldn't be tweaking the storage backends, but we expose it, so we should probably remove this whole comment but still have a changelog entry mentioning that any overridden values ought to be changed back / left alone unless you really know what you're doing. Do you agree?
There was a problem hiding this comment.
Actually this whole setting was just added in the last PR. Honestly it shouldn't be exposed, on second thought, and I'm just going to move that value to constants.
| through Pulp when object-storage redirects are disabled. Django storage | ||
| streams are synchronous, so open and close run in worker threads; reads | ||
| are dispatched there by `_sendfile()`. Preserve cleanup after errors or | ||
| early response termination. |
There was a problem hiding this comment.
We could maybe get native async with something based on obstore
Or if we were to update the vendored django-storages for it. I think the blocker is that boto3 hasn't supported it historically but it's being worked on.
There was a problem hiding this comment.
I believe the previous implementation would have been blocking in the executor as the executor isn't natively going to throw it to a separate thread.
There was a problem hiding this comment.
Not directly related to the PR, but if we wanna use obstore, do you envision something like replacing django-storages or kinda being integrated in the django-storages vendored code, like as a library?
There was a problem hiding this comment.
Probably the former. Or maybe the latter at first and then later the former.
| s3 = ["django-storages[boto3] @ git+https://github.com/dralley/django-storages.git@open-stream"] | ||
| google = ["django-storages[google] @ git+https://github.com/dralley/django-storages.git@open-stream"] | ||
| azure = ["django-storages[azure] @ git+https://github.com/dralley/django-storages.git@open-stream"] | ||
| s3 = ["django-storages[boto3]==1.14.6"] | ||
| google = ["django-storages[google]==1.14.6"] | ||
| azure = ["django-storages[azure]==1.14.6"] |
There was a problem hiding this comment.
I think, the result of this endeavour should be to replace the dependency on django-storages with the dependencies of the vendored code.
|
Made changes based on discussion with @pedro-psb. There's no need to have |
ccd6271 to
1dcfb63
Compare
Bundle the backend source in the pulpcore distribution and retain optional provider dependencies for S3, Azure, and GCS deployments.
Move the vendored backends under Pulp's package namespace so they cannot collide with an independently installed django-storages package. Update built-in backend mappings, test settings, and operator guidance to use the new import paths while preserving legacy Domain storage_class values. Assisted By: Codex (GPT-6)
Map the vendored compatibility path to Pulp's S3 backend so the S3 runner's configured storage passes the redirect backend check. Add regression coverage for backend identification and validation. Assisted By: Codex (GPT-6)
Move the implementation map out of Django settings so deployments use STORAGES for the default backend while Pulp selects implementations for other Domain storage IDs internally. Update resolution, tests, and admin documentation to reflect the internal mapping. Assisted By: Codex (GPT-6)
1dcfb63 to
e889eb3
Compare
| s3 = ["django-storages[boto3]==1.14.6"] | ||
| google = ["django-storages[google]==1.14.6"] | ||
| azure = ["django-storages[azure]==1.14.6"] | ||
| azure = ["azure-core>=1.13", "azure-storage-blob>=12"] | ||
| google = ["google-cloud-storage>=1.36.1"] | ||
| s3 = ["boto3>=1.4.4"] |
Avoid unnecessary buffering of large files by taking advantage of a streaming API in forked django-storages.
closes #7806
📜 Checklist
See: Pull Request Walkthrough